package com.ruoyi.web.controller.tool;

import com.ruoyi.common.core.redis.RedisLock;
import com.ruoyi.web.core.utils.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.concurrent.TimeUnit;

/* loaded from: TestLockController.class */
public class TestLockController {
    @Autowired
    private RedisLock redisLock;

    @RequestMapping({"/lock"})
    @ResponseBody
    public void lock(@RequestBody Message msg) {
        this.redisLock.lock("cjq");
        this.redisLock.tryLock("cjq", 3);
        this.redisLock.tryLock("cjq", 3, TimeUnit.SECONDS);
        this.redisLock.tryLock("cjq", 2, 1, TimeUnit.SECONDS);
        this.redisLock.unlock("cjq");
    }
}
